package com.lcy.attendance.user.controller;

import javax.inject.Inject;
import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.lcy.attendance.user.service.UserService;

@Controller
@RequestMapping("/user")
public class UserController {

	@Inject
	private UserService userService;
	
	@RequestMapping("/login")
	public String login() {
		return "login";
	}
	
	@RequestMapping("/updateUserPassword")
	public String updateUserPassword(String newPassword, int id, Model model, HttpSession session) {
		id = 1;
		userService.updateUserPassword(newPassword, id);
		model.addAttribute("message", "修改成功");
		return "main";
	}
	
}
